<template>
	<view>
		<u-icon name="level"></u-icon>
		<text class="iconfont icon-yanjing"></text>
		<uni-icons custom-prefix="iconfont" type="icon-yanjing" size="16"></uni-icons>
		<view class="fs-32 color-main">米家</view>
		<view class="fs-30  color-main2">米家</view>
		<view class="fs-28  color-main3">米家11</view>
		<view class="fs-26">米家</view>
		<view class="fs-24">米家</view>
		<view v-html="newhtml"></view>
		<view style="width: 100rpx;height: 100rpx;background: orange;"></view>
		1
		<view style="width: 100upx;height: 100upx;background: orange;"></view>
		<view @click="handleBack">返回上一页</view>
		vuex-goods
		<view>a:{{ goods.num }}</view>
		<view>b:{{ goods.totle }}</view>
		<button type="default" @click="changeGoods()">vuex修改goods.totle</button>
		
		vuex获取用户数据
		<view>{{ user.age }}</view>
		<image style="width: 120rpx;height: 120rpx;" :src="user.avtatr"></image>
		<view>{{ user.code }}</view>
		<view>{{ user.success }}</view>
		<view>{{ user.koken }}</view>
		<view>{{ user.userId }}</view>
		<view>{{ user.userName }}</view>
		<hr>
		本地存储获取用户数据
		<view>{{ info.age }}</view>
		<image style="width: 120rpx;height: 120rpx;" :src="info.avtatr"></image>
		<view>{{ info.code }}</view>
		<view>{{ info.success }}</view>
		<view>{{ info.koken }}</view>
		<view>{{ info.userId }}</view>
		<view>{{ info.userName }}</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			html: '<div><h2 style="height:200px">米家众测</h2><h2 style="height:200px">米家众测</h2><h3>米家众测</h3></div>',
			info: 777
		};
	},
	onLoad(e) {
		uni.setNavigationBarTitle({
			title: e.title
		});
	},
	mounted() {
		this.getinfo();
	},
	methods: {
		handleBack() {
			uni.navigateBack({
				delta: 1
			});
		},
		changeGoods() {
			this.goods.totle = 66666666666;
		},
		getinfo() {
			let _this = this;
			uni.getStorage({
				key: 'userInfo',
				success: function(res) {
					_this.info = res.data;
				}
			});
		}
	},
	computed: {
		newhtml() {
			return this.html.replace(/height:200px/g, 'height:50px');
		},
		goods() {
			return this.$store.state.goods;
		},
		user() {
			return this.$store.state.user.userInfo || {};
		}
	}
};
</script>

<style></style>
